/*    */ package com.wgcloud.service;
/*    */ 
/*    */ import com.github.pagehelper.PageHelper;
/*    */ import com.github.pagehelper.PageInfo;
/*    */ import com.wgcloud.entity.CpuState;
/*    */ import com.wgcloud.mapper.CpuStateMapper;
/*    */ import com.wgcloud.util.DateUtil;
/*    */ import com.wgcloud.util.UUIDUtil;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Service;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ @Service
/*    */ public class CpuStateService
/*    */ {
/*    */   @Autowired
/*    */   private CpuStateMapper cpuStateMapper;
/*    */   
/*    */   public PageInfo selectByParams(Map<String, Object> params, int currPage, int pageSize) throws Exception {
/* 27 */     PageHelper.startPage(currPage, pageSize);
/* 28 */     List<CpuState> list = this.cpuStateMapper.selectByParams(params);
/* 29 */     PageInfo<CpuState> pageInfo = new PageInfo(list);
/* 30 */     return pageInfo;
/*    */   }
/*    */   
/*    */   public void save(CpuState cpuState) throws Exception {
/* 34 */     cpuState.setId(UUIDUtil.getUUID());
/* 35 */     cpuState.setCreateTime(DateUtil.getNowTime());
/* 36 */     this.cpuStateMapper.save(cpuState);
/*    */   }
/*    */   
/*    */   public void saveRecord(List<CpuState> recordList) throws Exception {
/* 40 */     if (recordList.size() < 1) {
/*    */       return;
/*    */     }
/* 43 */     for (CpuState as : recordList) {
/* 44 */       as.setId(UUIDUtil.getUUID());
/*    */     }
/* 46 */     this.cpuStateMapper.insertList(recordList);
/*    */   }
/*    */   
/*    */   public int deleteById(String[] id) throws Exception {
/* 50 */     return this.cpuStateMapper.deleteById(id);
/*    */   }
/*    */   
/*    */   public CpuState selectById(String id) throws Exception {
/* 54 */     return this.cpuStateMapper.selectById(id);
/*    */   }
/*    */   
/*    */   public Double selectMaxByHostname(String hostname) throws Exception {
/* 58 */     return this.cpuStateMapper.selectMaxByHostname(hostname);
/*    */   }
/*    */ 
/*    */   
/*    */   public List<CpuState> selectAllByParams(Map<String, Object> params) throws Exception {
/* 63 */     return this.cpuStateMapper.selectAllByParams(params);
/*    */   }
/*    */   
/*    */   public int deleteByAccountAndDate(Map<String, Object> params) throws Exception {
/* 67 */     return this.cpuStateMapper.deleteByAccountAndDate(params);
/*    */   }
/*    */ }


/* Location:              /Users/zhangyongxin/soft-install/wgcloud/wgcloud-v3.3.5/server/bank/wgcloud-server-release.jar!/BOOT-INF/classes/com/wgcloud/service/CpuStateService.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */